﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Profile;
using System.Data;

namespace WebSite.admin.system
{
    public partial class shop_config03 : BaseAdmin
    {
        // Fields
        

        // Methods
        private void Bind()
        {
            string sql = "select top 1 * from DB_Shopconfig ";
            DataTable table = new DataTable();
            table = SQLAccess.GreatDs(sql).Tables[0];
            this.shopindexkey.Value = table.Rows[0]["shopindexkey"].ToString();
            this.shopdate.Value = table.Rows[0]["shopdate"].ToString();
            this.shoptime.Value = table.Rows[0]["shoptime"].ToString();
            this.shophuobi.Value = table.Rows[0]["shophuobi"].ToString();
            this.shopwidth.Value = table.Rows[0]["shopwidth"].ToString();
            this.shopheight.Value = table.Rows[0]["shopheight"].ToString();
            this.shopwidth1.Value = table.Rows[0]["shopwidth1"].ToString();
            this.shopheight1.Value = table.Rows[0]["shopheight1"].ToString();
            this.shoppainum.Value = table.Rows[0]["shoppainum"].ToString();
            this.shopoldnum.Value = table.Rows[0]["shopoldnum"].ToString();
            this.shoppingnum.Value = table.Rows[0]["shoppingnum"].ToString();
            this.shopxiannum.Value = table.Rows[0]["shopxiannum"].ToString();
            this.shopnewsnum.Value = table.Rows[0]["shopnewsnum"].ToString();
            this.shoppronum.Value = table.Rows[0]["shoppronum"].ToString();
            this.shoppriceze.SelectedValue = table.Rows[0]["shoppriceze"].ToString();
            this.shoppage.Value = table.Rows[0]["shoppage"].ToString();
            this.shopmoorder1.SelectedValue = table.Rows[0]["shopmoorder1"].ToString();
            this.shopmoorder2.SelectedValue = table.Rows[0]["shopmoorder2"].ToString();
            this.shoptypes.Value = table.Rows[0]["shoptypes"].ToString();
            this.shoppicnum.Value = table.Rows[0]["shoppicnum"].ToString();
            this.shoptitleleg.Value = table.Rows[0]["shoptitleleg"].ToString();
            this.shopcuntry1.Value = table.Rows[0]["shopcuntry1"].ToString();
            this.shopprovince1.Value = table.Rows[0]["shopprovince1"].ToString();
            this.shopcity1.Value = table.Rows[0]["shopcity1"].ToString();
            this.shoparea1.Value = table.Rows[0]["shoparea1"].ToString();
            this.shopnum2.Value = table.Rows[0]["shopnum2"].ToString();
            this.shopshowlink.SelectedValue = table.Rows[0]["shopshowlink"].ToString();
            this.shopshowlang.SelectedValue = table.Rows[0]["shopshowlang"].ToString();
            this.shopisopen.Checked = (bool)table.Rows[0]["shopisopen"];
            this.shopopeninfo.Text = table.Rows[0]["shopopeninfo"].ToString();
            this.homeshowpnum1.Value = table.Rows[0]["homeshowpnum1"].ToString();
            this.homeshowpnum2.Value = table.Rows[0]["homeshowpnum2"].ToString();
            this.homeshowpnum3.Value = table.Rows[0]["homeshowpnum3"].ToString();
            this.homeshowpnum4.Value = table.Rows[0]["homeshowpnum4"].ToString();
            this.homeshowpnum5.Value = table.Rows[0]["homeshowpnum5"].ToString();
            this.homeshownnum.Value = table.Rows[0]["homeshownnum"].ToString();
        }

        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            SQLAccess.DoSql("update DB_Shopconfig set shopwidth=" + re.replace(this.shopwidth.Value) + ",shopheight=" + re.replace(this.shopheight.Value) + ",shopwidth1=" + re.replace(this.shopwidth1.Value) + ",shopheight1=" + re.replace(this.shopheight1.Value) + ",homeshowpnum5=" + re.replace(this.homeshowpnum5.Value) + ",shopnum2=" + re.replace(this.shopnum2.Value) + ",shoppage=" + re.replace(this.shoppage.Value) + ",homeshowpnum1=" + re.replace(this.homeshowpnum1.Value) + ",homeshowpnum2=" + re.replace(this.homeshowpnum2.Value) + ",homeshowpnum3=" + re.replace(this.homeshowpnum3.Value) + ",homeshownnum=" + re.replace(this.homeshownnum.Value) + " where 1=1");
            base.Response.Write("<script language='javascript'>window.location.href='shop_config03.aspx';</script>");
            base.Response.End();
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Session["Adminlogin"] == null)
            {
                base.Response.Write("<script language=javascript>window.top.location.href='../login.aspx';</script>");
                base.Response.End();
            }
            if (!base.IsPostBack)
            {
                this.Bind();
            }
        }


    }
}